﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace NAccounting.Models
{
    public enum AccountEntrySaveMode
    { 
        Default = 0,
        SaveAndNew = 1,
        SaveAndCloseLot = 2
    }


    public class AccountEntryDetailModel
    {
        public string LotIsValidJs { get; set; }
        public int AccountEntryId { get; set; }
        public int LotId { get; set; }
        public string CanDelete { get; set; }

        [Required]
        [Range(1, 2, ErrorMessage = "Tipo de lançamento inválido.")]
        [Display(Name = "Tipo do Lançamento")]
        public string Type { get; set; }
        [Display(Name = "Lote")]
        public string LotDescription { get; set; }

        [Display(Name = "Período")]
        public string LotPeriod { get; set; }

        [Display(Name = "Total Débido")]
        public string LotTotalDebit { get; set; }
        [Display(Name = "Total Crédito")]
        public string LotTotalCredit { get; set; }

        public string MinDateJs { get; set; }
        public string MaxDateJs { get; set; }

        public int AccountPlanId { get; set; }
        [Required]
        [Display(Name = "Conta Contábil")]
        public string AccountPlanDescription { get; set; }

        [Required]
        [Display(Name = "Data")]
        public string AccountEntryDate { get; set; }

        [Required]
        [Display(Name = "Valor")]
        public string Value { get; set; }

        public int SaveMode { get; set; }

        [Required]
        [Display(Name = "Descrição")]
        [StringLength(100)]
        public string Description { get; set; }
    }

    public class AccountEntryListModel
    {
        [Display(Name = "Selecione a período:")]
        public string SelectedDateOption { get; set; }

        public SelectList DateOptions { get; set; }

        public AccountEntryListModel()
        {
            DateOptions = new SelectList(new FilterDateOptions().Options, "Key", "Text");
            SelectedDateOption = FilterDateOptionsEnum.ThisWeek.ToString();
        }
    }
}